const {Schema, model} = require('mongoose')

const messageSchema = new Schema(
  {
    senderId: {
      type: String,
      required: true,
      ref: 'Users',
    },
    recipientId: {
      type: String,
      required: true,
      ref: 'Users',
    },
    message: {
      type: String,
      required: true,
    },
  },
  {timestamps: true},
)

module.exports = model('Message', messageSchema)
